package com.hd.boot.controller;

import com.hd.boot.pojo.Teacher;
import com.hd.boot.service.TeacherService;
import com.hd.boot.util.JsonData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/teacher")
public class TeacherController {
    @Autowired
    private TeacherService teacherService;

    @RequestMapping("/allTea")
     public JsonData allTea(){
        JsonData jsonData=teacherService.allTea();
        return jsonData;
    }

    @RequestMapping("/delTea")
    public JsonData delTea(int teaId){
        JsonData jsonData=teacherService.delTea(teaId);
        return jsonData;
    }
    @RequestMapping("/saveTea")
    public JsonData saveTea(Teacher teacher){
        JsonData jsonData= teacherService.saveTea(teacher);
        return jsonData;
    }
}
